package scauCmiScaffolding.compiled;

import org.eclipse.jet.JET2Context;
import org.eclipse.jet.JET2Template;
import org.eclipse.jet.JET2Writer;
import org.eclipse.jet.taglib.RuntimeTagElement;
import org.eclipse.jet.taglib.TagInfo;

public class _jet_pageHeadOldVersion_0 implements JET2Template {
    private static final String _jetns_c = "org.eclipse.jet.controlTags"; //$NON-NLS-1$
    private static final String _jetns_f = "org.eclipse.jet.formatTags"; //$NON-NLS-1$

    public _jet_pageHeadOldVersion_0() {
        super();
    }

    private static final String NL = System.getProperty("line.separator"); //$NON-NLS-1$
    
    private static final TagInfo _td_f_replaceAll_1_1 = new TagInfo("f:replaceAll", //$NON-NLS-1$
            1, 1,
            new String[] {
                "value", //$NON-NLS-1$
                "replacement", //$NON-NLS-1$
            },
            new String[] {
                "Dollar_symbol", //$NON-NLS-1$
                "$", //$NON-NLS-1$
            } );
    private static final TagInfo _td_c_replaceStrings_1_53 = new TagInfo("c:replaceStrings", //$NON-NLS-1$
            1, 53,
            new String[] {
                "replace", //$NON-NLS-1$
                "with", //$NON-NLS-1$
            },
            new String[] {
                "%Left_angle_brackets,%Right_angle_brackets,cchoose,cwhen,cset,cotherwise,cforEach,cif", //$NON-NLS-1$
                "<,>,c:choose,c:when,c:set,c:otherwise,c:forEach,c:if", //$NON-NLS-1$
            } );

    public void generate(final JET2Context context, final JET2Writer __out) {
        JET2Writer out = __out;
        RuntimeTagElement _jettag_f_replaceAll_1_1 = context.getTagFactory().createRuntimeTag(_jetns_f, "replaceAll", "f:replaceAll", _td_f_replaceAll_1_1); //$NON-NLS-1$ //$NON-NLS-2$
        _jettag_f_replaceAll_1_1.setRuntimeParent(null);
        _jettag_f_replaceAll_1_1.setTagInfo(_td_f_replaceAll_1_1);
        _jettag_f_replaceAll_1_1.doStart(context, out);
        JET2Writer _jettag_f_replaceAll_1_1_saved_out = out;
        while (_jettag_f_replaceAll_1_1.okToProcessBody()) {
            out = out.newNestedContentWriter();
            RuntimeTagElement _jettag_c_replaceStrings_1_53 = context.getTagFactory().createRuntimeTag(_jetns_c, "replaceStrings", "c:replaceStrings", _td_c_replaceStrings_1_53); //$NON-NLS-1$ //$NON-NLS-2$
            _jettag_c_replaceStrings_1_53.setRuntimeParent(_jettag_f_replaceAll_1_1);
            _jettag_c_replaceStrings_1_53.setTagInfo(_td_c_replaceStrings_1_53);
            _jettag_c_replaceStrings_1_53.doStart(context, out);
            JET2Writer _jettag_c_replaceStrings_1_53_saved_out = out;
            while (_jettag_c_replaceStrings_1_53.okToProcessBody()) {
                out = out.newNestedContentWriter();
                out.write("\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t<div class=\"scau-table-control\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t<div class=\"scau-page-control\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t<input  class=\"scau-confirm\" type=\"submit\"  value=\"confirm\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t<select name=\"paginationSize\"  class=\"form-control\">    ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t<option value=\"10\"   label=\"10\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t<option value=\"20\"  label=\"20\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t<option value=\"50\"  label=\"50\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t<option value=\"100\"  label=\"100\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t</select>every  page of records");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t</div>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t<cforEach   begin=\"1\"  end=\"Dollar_symbol{basicAttributesSize}\"  step=\"1\"  var=\"i\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t<div class=\"scau-search-control\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t<cchoose>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t<cwhen test=\"Dollar_symbol{i <= page.queryBoxNumber}\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t<div id=\"queryBoxDollar_symbol{i}\" >");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t<select id=\"queryBoxSelectDollar_symbol{i}\"  name=\"combinedSelectConditions\"  class=\"form-control\"   onfocus=\"selectOptionDymaticModify(Dollar_symbol{i})\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t<cforEach items=\"Dollar_symbol{basicAttributes}\" var=\"current\" >");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t\t<option  value=\"Dollar_symbol{current}\"  Dollar_symbol{current == page.combinedSelectConditions[i-1]?'selected':''} >SearchByDollar_symbol{current}</font></option>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t</cforEach>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t</select> ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t<input  id=\"queryBoxInputDollar_symbol{i}\"   type=\"text\"  name=\"combinedConditions\" value=\"Dollar_symbol{page.combinedConditions[i-1]}\" oninput=\"changeQueryBox(Dollar_symbol{i})\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t</div>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t</cwhen>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t<cotherwise>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t<div id=\"queryBoxDollar_symbol{i}\" style=\"display:none\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t<select  id=\"queryBoxSelectDollar_symbol{i}\" name=\"combinedSelectConditions\"  class=\"form-control\"  disabled=\"true\" onfocus=\"selectOptionDymaticModify(Dollar_symbol{i})\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t<cforEach items=\"Dollar_symbol{basicAttributes}\" var=\"current\" >");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"Dollar_symbol{current}\">SearchByDollar_symbol{current}</font></option>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t\t</cforEach>  ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t</select> ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t\t<input  id=\"queryBoxInputDollar_symbol{i}\"  type=\"text\"  name=\"combinedConditions\" disabled=\"true\"  oninput=\"changeQueryBox(Dollar_symbol{i})\"  />");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t\t</div>\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t\t</cotherwise>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\t</cchoose>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t</div>    ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t</cforEach>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t<input class=\"scau-save\" type=\"submit\"  name=\"Search\"/>");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t</div>  ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t<script type=\"text/javascript\">");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar  queryBoxNumber = \"Dollar_symbol{page.queryBoxNumber}\";   //现有的显示的搜索框的数量");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar  queryBoxMaxNumber = \"Dollar_symbol{basicAttributesSize}\"\t\t//查询框最大数量\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar basicAttributesSize = \"Dollar_symbol{basicAttributesSize}\";   //基本属性  ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t//将属性字符串转化成数组");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar basicAttributesString = \"Dollar_symbol{basicAttributes}\".replace(\"[\",\"\").replace(\"]\",\"\").split(\",\");   ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tvar basicAttributes = new Array();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tfor(var i = 0; i < basicAttributesString.length; i++){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tbasicAttributes.push(basicAttributesString[i].trim());");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}  ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t//改变搜索框的数量");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\tfunction  changeQueryBox(number){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tvar queryBoxInput = Dollar_symbol(\"#queryBoxInput\" + number);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tif(queryBoxInput.val()  != \"\"){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t \tif(queryBoxNumber < queryBoxMaxNumber && number == queryBoxNumber){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t \t\tif(queryBoxNumber < queryBoxMaxNumber){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t \t\t\tqueryBoxNumber++;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t \t\tselectOptionDymaticModify(queryBoxNumber);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t \tDollar_symbol(\"#queryBox\" + (number + 1)).show();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t \tDollar_symbol(\"#queryBoxSelect\" + (number + 1)).attr(\"disabled\",false);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t \tDollar_symbol(\"#queryBoxInput\" + (number + 1)).attr(\"disabled\",false);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t \t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t \t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t//动态生成搜索的属性");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" \t\tfunction  selectOptionDymaticModify(number){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write(" \t\t\tvar indexArray = new Array();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tfor(var i = 1; i <= queryBoxNumber; i++){   ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tif(i != number){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tvar optionSelected = Dollar_symbol(\"#queryBoxSelect\" + i).find(\"option:selected\").val();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tvar index = basicAttributes.indexOf(optionSelected) + 1;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tif(index != -1){  ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t\t\tindexArray.push(index);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t \t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tindexArray.sort();");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t//重新设置属性并添加");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tvar select = document.getElementById(\"queryBoxSelect\" + number);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tselect.options.length=0;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\tfor(var i = 1,k = 0,l = 1; i <= queryBoxMaxNumber; i++){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\tif(i <= indexArray[indexArray.length - 1] && indexArray[k] == i){");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tk++;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}else{");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tvar option = document.createElement(\"OPTION\");");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\toption.id = \"queryBoxOption\" + number + l;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\toption.value = \"\" + basicAttributes[i - 1];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\toption.text = \"SearchBy\" + basicAttributes[i - 1];");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tl++;");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t\tselect.options.add(option);");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t\t}");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t\t} ");  //$NON-NLS-1$        
                out.write(NL);         
                out.write("\t</script>");  //$NON-NLS-1$        
                out.write(NL);         
                _jettag_c_replaceStrings_1_53.handleBodyContent(out);
            }
            out = _jettag_c_replaceStrings_1_53_saved_out;
            _jettag_c_replaceStrings_1_53.doEnd();
            out.write(NL);         
            _jettag_f_replaceAll_1_1.handleBodyContent(out);
        }
        out = _jettag_f_replaceAll_1_1_saved_out;
        _jettag_f_replaceAll_1_1.doEnd();
    }
}
